RefineryAdFactory

API exposing creation and management of ad objects.

Functions

Link copied to clipboard
fun createBanner(configurationID: String, wrapper: ViewGroup, lifecycleCallbacks: <Error class: unknown class>? = null): Int

Creates banner type ad inside of a wrapper. Banner is a fixed size static ad. First we cache the ad, load it and when it loads we display it in wrapper

Link copied to clipboard
fun createInfiniteScroll(configurationID: String, scrollView: ViewGroup, scrollItemAdWrapperTag: String, lifecycleCallbacks: <Error class: unknown class>? = null): Int

Adds banner and video banner type of ads to scrollView infinite scroll. Ads are placed inside of an infinite scrolls individual item. Number and frequency of ads shown are set by the configuration corresponding to configurationID

Link copied to clipboard
fun createInterstitial(configurationID: String, activity: Activity, afterInterstitial: () -> Unit, lifecycleCallbacks: <Error class: unknown class>? = null): Int

Creates Interstitial ad which will be shown in the process of transition from one activity to another. You can also configure what to do after Interstitial in afterInterstitial

Link copied to clipboard
fun createManualInfiniteScroll(configurationID: String, lifecycleCallbacks: <Error class: unknown class>? = null): Int

Creates an infinite scroll for manual configuration. Ads are placed inside of an infinite scrolls individual item. Number and frequency of ads shown are set by the configuration corresponding to configurationID

Link copied to clipboard
fun createRewarded(configurationID: String, activity: Activity, afterInterstitial: () -> Unit, rewardReceived: (<Error class: unknown class>) -> Unit, lifecycleCallbacks: <Error class: unknown class>? = null): Int

Creates Rewarded Interstitial ad which will be shown when ever you want to provide a reward in exchange for showing an ad.

Link copied to clipboard
fun createVideoInterstitial(configurationID: String, activity: Activity, afterInterstitial: () -> Unit, lifecycleCallbacks: <Error class: unknown class>? = null): Int

Creates Video Interstitial ad which will be shown in the process of transition from one activity to another. You can also configure what to do after Interstitial in afterInterstitial Use getInfiniteScrollAdForIndex with return id of this function to set views.

Link copied to clipboard
fun createVideoOutstreamBanner(configurationID: String, wrapper: ViewGroup, lifecycleCallbacks: <Error class: unknown class>? = null): Int

Create a video banner (OutStream) type ad inside of a wrapper. Video banner (OutStream) is a fixed size video ad. First we cache the ad, load it and when it loads we display it in wrapper cleans the wrapper from all the views that it might have and creates a video banner inside it

Link copied to clipboard
fun destroyAd(index: Int)

Removes the ad with this Index from the available objects cache and deletes it from any memory. This means you are no longer able to show or hide this ad

Link copied to clipboard

Empties memory from any ad objects and returns all the wrappers to the original state

Link copied to clipboard
fun getInfiniteScrollAdForIndex(infiniteScrollId: Int, itemIndex: Int, itemAdWrapper: ViewGroup, childAdLifecycle: <Error class: unknown class>? = null): Boolean
Link copied to clipboard
fun hide(index: Int)

Removes R89Wrapper with ad view from publishers wrapper.

Link copied to clipboard
fun hideInfiniteScrollAdForIndex(infiniteScrollId: Int, itemIndex: Int)

Hides the ad for an item if existing

Link copied to clipboard
fun show(index: Int)

Adds R89Wrapper with ad view to publishers wrapper. If publishers wrapper already contains R89Wrapper then this function replaces it with new R89Wrapper